# -*- coding: utf-8 -*-
from db.mysql import MysqlClient
from common.helper import Helper
from itertools import product
class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "泰康少儿重疾保"

    def pullData(self,data={}):
        prices = ["66.00","132.00","198.00","264.00"]
        plan = {
            "year":["0-17岁"],
            "majorDisease":["10w","20w","30w","40w","40w+"],
        }
        num = 0
        for v in product(plan["year"],plan["majorDisease"]):
            if v[1] == "40w+":
                data = {
                    "name":self.name,
                    "company":"泰康保险",
                    "year":v[0],
                    "majorDisease":"40w",
                    "slightDisease":"20w",
                    "expire":"1年",
                    "payType":"年交",
                    "price":"364.00"
                }

            else:
                data = {
                    "name": self.name,
                    "company": "泰康保险",
                    "year": v[0],
                    "majorDisease":v[1],
                    "slightDisease": "/",
                    "expire": "1年",
                    "payType": "年交",
                    "price": prices[num]
                }
                num+=1
            Helper.mergeTable( self.name,self.mysql,data )

